package Logic;

import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Model.StaffAppointment;

import com.mysql.jdbc.DatabaseMetaData;

/**
 * Servlet implementation class StaffAppNew_BLL
 */
@WebServlet("/StaffApp_Rollback_BLL")
public class StaffApp_Rollback_BLL extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public StaffApp_Rollback_BLL() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		//javax.servlet.http.HttpSession session = request.getSession();
		//String username = session.getAttribute("username").toString();
		
		String md5 = request.getParameter("md5");
		Database.StaffAppointmentDB.rollback(md5);
		response.sendRedirect("staffapp_newappt.jsp");
	}

}
